package com.company.project.component.shiro.auth;

import org.apache.shiro.authc.AuthenticationInfo;
import org.apache.shiro.authc.AuthenticationToken;
import org.apache.shiro.authc.UsernamePasswordToken;
import org.apache.shiro.authc.credential.SimpleCredentialsMatcher;

/**
 * 没多大用处
 * Created with IntelliJ IDEA.
 * Date: 2017/11/7
 * Time: 10:36
 * function:
 */
public class CredentialsMatcher extends SimpleCredentialsMatcher {

    @Override
    public boolean doCredentialsMatch(AuthenticationToken token, AuthenticationInfo info) {
        return true;
//        UsernamePasswordToken utoken=(UsernamePasswordToken) token;
//        //获得用户输入的密码:(可以采用加盐(salt)的方式去检验)
//        String inPassword = new String(utoken.getPassword());
//        //获得数据库中的密码
//        String dbPassword=(String) info.getCredentials();
//
//        System.out.println("inPassword的值为:"+inPassword+"   dbPassword的值为:"+dbPassword);
//
//        //进行密码的比对
//        return this.equals(inPassword, dbPassword);
    }

}